Full source code website bán hàng thương mại điện tử gần giống shopee
469.004 lượt xem;
1 <?
2 if (isset($_POST['butSaveLoai'])) {
3 $name=trim($_POST['txtName']);
4 $address=$_POST['txtAddress'];
5 $phone=$_POST['txtPhone'];
6 $email=$_POST['txtEmail'];
7 $skype=$_POST['skype'];
8 $status=$_POST['chkShow'];
9 $date=date("d-m-Y");
10
11 if ($address=="")
12 {
13 echo "<p align=center class='err'>Bạn chưa nhập tên IM</p>";
14 }
15 else
16 {
17 if (!empty($_POST['oldid'])) {
18 $oldid = $_POST['oldid'];
19 $sql = "update support set name='".$name."', yahoo='".$address."',skype='".$skype."', phone='".$phone."', email='".$email."', thutu=".$status." where id='".$oldid."'";
20 }
21 else
22 $sql = "insert into support (name, yahoo,skype, phone, email, thutu, date) values ('".$name."','".$address."','".$skype."','".$phone."','".$email."','".$status."','".$date."')";
23 if (mysql_query($sql,$con)) {
24 echo "<p align=center class='err'>Đã cập nhật thành công</p><br>";
25 echo "<script>window.location='index.php?act=online&page=".$_REQUEST['page']."'</script>";
26 }
27 else echo "<p align=center class='err'>Không thể cập nhật</p>";
28 }
29 }
30 ?>
31
32 <?
33 if (isset($_GET['id'])) {
34 $oldid=$_GET['id'];
35 $sql = "select * from support where id='".$oldid."'";
36 if ($result = mysql_query($sql,$con)) {
37 $row=mysql_fetch_array($result);
38 $name=$row['name'];
39 $address=$row['yahoo'];
40 $phone=$row['phone'];
41 $skype=$row['skype'];
42 $email=$row['email'];
43 $status=$row['thutu'];
44 $date=$row['date'];
45 }
46 }
47 ?>
48
49 <form method="POST" name="FormLoaiSP" action="index.php">
50 <input type=hidden name="act" value="online_m">
51 <input type=hidden name="oldid" value="<? echo $oldid; ?>">
52 <input type=hidden name="page" value="<? echo $_REQUEST['page']; ?>">
53 <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#0069A8" width="100%" id="AutoNumber1">
54 <tr>
55 <td width="45%" height="20" align="center" class="title">
56 Thêm mới / Cập nhật : Online</td>
57 </tr>
58 <tr>
59 <td width="45%">
60 <table border="0" cellpadding="4" bordercolor="#111111" width="124%" id="AutoNumber2" cellspacing="0">
61 <tr>
62 <td width="15%" class="smallfont">
63 <p align="right">Tên trực tuyến</td>
64 <td width="1%" class="smallfont">
65 <font color="#FF0000">*</font></td>
66 <td width="83%" class="smallfont">
67 <INPUT value="<? echo $name; ?>" TYPE="text" NAME="txtName" CLASS=textbox size="34"></td>
68 </tr>
69 <tr>
70 <td width="15%" class="smallfont">
71 <p align="right">Yahoo ID</td>
72 <td width="1%" class="smallfont">
73 <font color="#FF0000">*</font></td>
74 <td width="83%" class="smallfont">
75 <INPUT value="<? echo $address; ?>" TYPE="text" NAME="txtAddress" CLASS=textbox size="34"></td>
76 </tr>
77 <tr>
78 <td width="15%" class="smallfont">
79 <p align="right">Skype ID</td>
80 <td width="1%" class="smallfont">
81 <font color="#FF0000">*</font></td>
82 <td width="83%" class="smallfont">
83 <INPUT value="<? echo $skype; ?>" TYPE="text" NAME="skype" CLASS=textbox size="34"></td>
84 </tr>
85 <tr>
86 <td width="15%" class="smallfont">
87 <p align="right">Điện thoại</td>
88 <td width="1%" class="smallfont">
89 </td>
90 <td width="83%" class="smallfont">
91 <INPUT value="<? echo $phone; ?>" TYPE="text" NAME="txtPhone" CLASS=textbox size="34"></td>
92 </tr>
93 <tr>
94 <td width="15%" class="smallfont" align="right">
95 Thu tu</td>
96 <td width="1%" class="smallfont" align="right">
97 </td>
98 <td width="83%" class="smallfont">
99 <input type="text" value="<? echo $status; ?>" name="chkShow"></td>
100 </tr>
101 <tr>
102 <td width="15%" class="smallfont" align="right">
103 Email</td>
104 <td width="1%" class="smallfont" align="right">
105 </td>
106 <td width="83%" class="smallfont">
107 <INPUT value="<? echo $email; ?>" TYPE="text" NAME="txtEmail" CLASS=textbox size="34"></td>
108 </tr>
109 <tr>
110 <td width="15%" class="smallfont">
111 <p align="right"><INPUT TYPE="submit" NAME="butSaveLoai" VALUE=" Lưu " CLASS=button> </td>
112 <td width="1%" class="smallfont">
113 </td>
114 <td width="83%" class="smallfont"><p align="left"> <INPUT TYPE="reset" CLASS=button></td>
115 </tr>
116 </table>
117 </td>
118 </tr>
119 </table>
120 </form>
2 if (isset($_POST['butSaveLoai'])) {
3 $name=trim($_POST['txtName']);
4 $address=$_POST['txtAddress'];
5 $phone=$_POST['txtPhone'];
6 $email=$_POST['txtEmail'];
7 $skype=$_POST['skype'];
8 $status=$_POST['chkShow'];
9 $date=date("d-m-Y");
10
11 if ($address=="")
12 {
13 echo "<p align=center class='err'>Bạn chưa nhập tên IM</p>";
14 }
15 else
16 {
17 if (!empty($_POST['oldid'])) {
18 $oldid = $_POST['oldid'];
19 $sql = "update support set name='".$name."', yahoo='".$address."',skype='".$skype."', phone='".$phone."', email='".$email."', thutu=".$status." where id='".$oldid."'";
20 }
21 else
22 $sql = "insert into support (name, yahoo,skype, phone, email, thutu, date) values ('".$name."','".$address."','".$skype."','".$phone."','".$email."','".$status."','".$date."')";
23 if (mysql_query($sql,$con)) {
24 echo "<p align=center class='err'>Đã cập nhật thành công</p><br>";
25 echo "<script>window.location='index.php?act=online&page=".$_REQUEST['page']."'</script>";
26 }
27 else echo "<p align=center class='err'>Không thể cập nhật</p>";
28 }
29 }
30 ?>
31
32 <?
33 if (isset($_GET['id'])) {
34 $oldid=$_GET['id'];
35 $sql = "select * from support where id='".$oldid."'";
36 if ($result = mysql_query($sql,$con)) {
37 $row=mysql_fetch_array($result);
38 $name=$row['name'];
39 $address=$row['yahoo'];
40 $phone=$row['phone'];
41 $skype=$row['skype'];
42 $email=$row['email'];
43 $status=$row['thutu'];
44 $date=$row['date'];
45 }
46 }
47 ?>
48
49 <form method="POST" name="FormLoaiSP" action="index.php">
50 <input type=hidden name="act" value="online_m">
51 <input type=hidden name="oldid" value="<? echo $oldid; ?>">
52 <input type=hidden name="page" value="<? echo $_REQUEST['page']; ?>">
53 <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#0069A8" width="100%" id="AutoNumber1">
54 <tr>
55 <td width="45%" height="20" align="center" class="title">
56 Thêm mới / Cập nhật : Online</td>
57 </tr>
58 <tr>
59 <td width="45%">
60 <table border="0" cellpadding="4" bordercolor="#111111" width="124%" id="AutoNumber2" cellspacing="0">
61 <tr>
62 <td width="15%" class="smallfont">
63 <p align="right">Tên trực tuyến</td>
64 <td width="1%" class="smallfont">
65 <font color="#FF0000">*</font></td>
66 <td width="83%" class="smallfont">
67 <INPUT value="<? echo $name; ?>" TYPE="text" NAME="txtName" CLASS=textbox size="34"></td>
68 </tr>
69 <tr>
70 <td width="15%" class="smallfont">
71 <p align="right">Yahoo ID</td>
72 <td width="1%" class="smallfont">
73 <font color="#FF0000">*</font></td>
74 <td width="83%" class="smallfont">
75 <INPUT value="<? echo $address; ?>" TYPE="text" NAME="txtAddress" CLASS=textbox size="34"></td>
76 </tr>
77 <tr>
78 <td width="15%" class="smallfont">
79 <p align="right">Skype ID</td>
80 <td width="1%" class="smallfont">
81 <font color="#FF0000">*</font></td>
82 <td width="83%" class="smallfont">
83 <INPUT value="<? echo $skype; ?>" TYPE="text" NAME="skype" CLASS=textbox size="34"></td>
84 </tr>
85 <tr>
86 <td width="15%" class="smallfont">
87 <p align="right">Điện thoại</td>
88 <td width="1%" class="smallfont">
89 </td>
90 <td width="83%" class="smallfont">
91 <INPUT value="<? echo $phone; ?>" TYPE="text" NAME="txtPhone" CLASS=textbox size="34"></td>
92 </tr>
93 <tr>
94 <td width="15%" class="smallfont" align="right">
95 Thu tu</td>
96 <td width="1%" class="smallfont" align="right">
97 </td>
98 <td width="83%" class="smallfont">
99 <input type="text" value="<? echo $status; ?>" name="chkShow"></td>
100 </tr>
101 <tr>
102 <td width="15%" class="smallfont" align="right">
103 Email</td>
104 <td width="1%" class="smallfont" align="right">
105 </td>
106 <td width="83%" class="smallfont">
107 <INPUT value="<? echo $email; ?>" TYPE="text" NAME="txtEmail" CLASS=textbox size="34"></td>
108 </tr>
109 <tr>
110 <td width="15%" class="smallfont">
111 <p align="right"><INPUT TYPE="submit" NAME="butSaveLoai" VALUE=" Lưu " CLASS=button> </td>
112 <td width="1%" class="smallfont">
113 </td>
114 <td width="83%" class="smallfont"><p align="left"> <INPUT TYPE="reset" CLASS=button></td>
115 </tr>
116 </table>
117 </td>
118 </tr>
119 </table>
120 </form>